package com.weiz.designpatterns.visitor;

import lombok.Data;

/**
 * 兼职员工类：具体元素类
 */
@Data
class ParttimeEmployee implements Employee
{
    private String name;
    private double hourWage;
    private int workTime;

    public ParttimeEmployee(String name,double hourWage,int workTime)
    {
        this.name = name;
        this.hourWage = hourWage;
        this.workTime = workTime;
    }

    public void accept(Department handler){
        handler.visit(this); //调用访问者的访问方法
    }
}